home *** CD-ROM | disk | FTP | other *** search
- // Dynamic link library implementation of NeuroSolutions Axon component
-
- #include "NSDLL.h"
-
- /****************************/
- /* Transform implementation */
-
- __declspec(dllexport) BOOL performTransform(
- DLLData *instance, // Pointer to instance data
- NSFloat *data, // Pointer to the buffered data
- int length, // Length of the buffer to be transformed
- int channel // Current channal number
- )
- {
- int i,j, start=0, stop=length;
- NSFloat *corr = (NSFloat*)calloc(length, sizeof(NSFloat));
-
- for (i=0; i<length; i++) {
- for (j=start; j<stop; j++)
- corr[i] += data[j]*data[j-start];
- start++;
- }
- for (i=0; i<length; i++)
- data[i] = corr[i];
- free(corr);
-
- // Return whether or not to display this channel
- return TRUE;
- }
-
- /******************************************/
- /* Management of instance data (OPTIONAL) */
- /*
- __declspec(dllexport) DLLData *allocTransform(
- DLLData *oldInstance, // Pointer to the last instance if reallocating
- int length, // Length of the buffer to be transformed
- int channels // Number of channels to be transformed
- )
- {
- DLLData instance=NULL;
- return instance;
- }
-
- __declspec(dllexport) void freeTransform(DLLData *instance)
- {
- freeDLLInstance(instance);
- }
- */
-